package com.xiaoy.core.workflow.engine.api;

import java.util.List;

import com.xiaoy.core.workflow.engine.exception.BPMEngineException;
import com.xiaoy.core.workflow.simple.entity.InstanceProcessVO;
import com.xiaoy.core.workflow.simple.entity.ProcessDefine;
import com.xiaoy.core.workflow.simple.entity.ProcessInstantiate;
import com.xiaoy.core.workflow.simple.entity.ProcessTask;


/**
 * 提供流程接口的api,屏蔽各种流程引擎 
 * @author chenty
 * 创建时间 2012-5-9
 */
public interface WorkFlow {
	
	
	
	
	/**
	 * 得到uaername的待办任务
	 * @param username
	 * @return
	 */
	public ProcessTask getTaskByUsername (String username);
	
	

	/**
	 * 删除一个部署的流程
	 * @param deploymentId
	 */
	public void delete (String id) ;
	
	/**
	 * 得到一个部署流程的详细信息
	 * @param id
	 * @return
	 */
	public ProcessDefine getProcessDefineById(String id);
	
	
	
	
	/**
	 * 
	 * 获得所有发布了的流程
	 * @return List<ProcessDefine> 所有流程定义
	 * @throws BPMEngineException
	 */
	public List<ProcessDefine> getAllProcessDefinitions() throws BPMEngineException;
	
	/**
	 * 开始一个流程实例
	 * @param id 部署的流程的流程id
	 * @param map 流程变量
	 * @return 
	 * @throws BPMEngineException
	 */
	public ProcessInstantiate createProcessInstanceById(InstanceProcessVO createProcessVO) throws BPMEngineException;
	
	/**
	 * 部署一个流程
	 * @param objs
	 * @return
	 * @throws BPMEngineException
	 */
	public ProcessDefine DefineProcess (Object...objs) throws BPMEngineException;
}
